package com.boboPlanet.dict.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.boboPlanet.comm.constance.DataSource;
import com.boboPlanet.comm.entity.po.SysDictConfigPO;
import com.boboPlanet.dict.mapper.BaseDictConfigMapper;
import com.boboPlanet.dict.service.BaseDictConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description: TODO  基础配置类中所有获取配置的方法上都加 @DS("dict") 数据源
 * @Author: mis_wu
 * @Date: 2023/2/16
 **/
@Slf4j
@Service
public class BaseDictConfigServiceImpl implements BaseDictConfigService {

    @Resource
    private BaseDictConfigMapper baseDictConfigMapper;

    @Override
    @DS(DataSource.DICT)
    public SysDictConfigPO queryBaseConfigByCode(String code) {
        return baseDictConfigMapper.queryBaseConfigByCode(code);
    }
}
